package com.salelogistics.basic.service.impl;

import java.util.List;
import com.salelogistics.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.salelogistics.basic.mapper.BasCarrierMapper;
import com.salelogistics.basic.domain.BasCarrier;
import com.salelogistics.basic.service.IBasCarrierService;

/**
 * 承运商Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-09
 */
@Service
public class BasCarrierServiceImpl implements IBasCarrierService 
{
    @Autowired
    private BasCarrierMapper basCarrierMapper;

    /**
     * 查询承运商
     * 
     * @param carrierId 承运商主键
     * @return 承运商
     */
    @Override
    public BasCarrier selectBasCarrierByCarrierId(Long carrierId)
    {
        return basCarrierMapper.selectBasCarrierByCarrierId(carrierId);
    }

    /**
     * 查询承运商列表
     * 
     * @param basCarrier 承运商
     * @return 承运商
     */
    @Override
    public List<BasCarrier> selectBasCarrierList(BasCarrier basCarrier)
    {
        return basCarrierMapper.selectBasCarrierList(basCarrier);
    }

    /**
     * 新增承运商
     * 
     * @param basCarrier 承运商
     * @return 结果
     */
    @Override
    public int insertBasCarrier(BasCarrier basCarrier)
    {
        basCarrier.setCreateTime(DateUtils.getNowDate());
        return basCarrierMapper.insertBasCarrier(basCarrier);
    }

    /**
     * 修改承运商
     * 
     * @param basCarrier 承运商
     * @return 结果
     */
    @Override
    public int updateBasCarrier(BasCarrier basCarrier)
    {
        return basCarrierMapper.updateBasCarrier(basCarrier);
    }

    /**
     * 批量删除承运商
     * 
     * @param carrierIds 需要删除的承运商主键
     * @return 结果
     */
    @Override
    public int deleteBasCarrierByCarrierIds(Long[] carrierIds)
    {
        return basCarrierMapper.deleteBasCarrierByCarrierIds(carrierIds);
    }

    /**
     * 删除承运商信息
     * 
     * @param carrierId 承运商主键
     * @return 结果
     */
    @Override
    public int deleteBasCarrierByCarrierId(Long carrierId)
    {
        return basCarrierMapper.deleteBasCarrierByCarrierId(carrierId);
    }
}
